package com.tledu.collection;

import java.util.ArrayList;
import java.util.List;

/**
 * 对象池
 */
public class ProjectPool<T> {
    private List<T> list = new ArrayList<>();

    public void add(T t) {
        list.add(t);
    }

    public T get(int i) {
        return list.get(i);
    }

    public int size() {
        return list.size();
    }

    public static void main(String[] args) {
        ProjectPool<Student> studentProjectPool = new ProjectPool<>();

        studentProjectPool.add(new Student(99, "李白"));

        System.out.println(studentProjectPool.get(0).getName());
    }
}
